package basicas;

import java.text.SimpleDateFormat;
import java.text.ParseException;

public class ValidarDate {

  public boolean validDate(String inDate) {

    if (inDate == null){
      return false;
    }
    
    //set the format to use as a constructor argument
    SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
    
    if (inDate.trim().length() != dateFormat.toPattern().length())
      return false;

    dateFormat.setLenient(false);
    
    try {
      //parse the inDate parameter
      dateFormat.parse(inDate.trim());
    }
    catch (ParseException pe) {
      return false;
    }
    return true;
  }
  
  
 
}
